package com.wltjack.springboot.vo.common;

import java.util.List;

import com.wltjack.springboot.vo.BaseObject;

/**
 * 分页对象
 */
public class PageVO extends BaseObject {
	private static final long serialVersionUID = -2238813018954485309L;
	private Integer pageNo;// 页码
	private Integer pageSize;// 每页显示条数
	private Integer pageCount;// 总页数
	private Integer total;// 总量
	private List<?> dataList;// 内容集合

	public PageVO() {
	}

	public PageVO(Integer pageNo, Integer pageSize, Integer pageCount, Integer total, List<?> dataList) {
		super();
		if (total == null) {
			total = 0;
		}
		this.pageNo = pageNo;
		this.pageSize = pageSize;
		if (pageSize > 0) {
			this.pageCount = (int) Math.ceil((double) total / (double) pageSize);
		}
		this.total = total;
		this.dataList = dataList;
	}

	public Integer getPageNo() {
		return pageNo;
	}

	public void setPageNo(Integer pageNo) {
		this.pageNo = pageNo;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getPageCount() {
		return pageCount;
	}

	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}

	public List<?> getDataList() {
		return dataList;
	}

	public void setDataList(List<?> dataList) {
		this.dataList = dataList;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

}
